package com.twu.biblioteca;

/**
 * Created by sravanns on 19/06/14.
 */
public class User {
    private String name;
    private String email;
    private String phone;
    private String password;

    public User(String name,String email,String phone,String password) {
        this.name = name;
        this.email=email;
        this.phone=phone;
        this.password=password;
    }
    protected String getName()
    {
        return name;
    }
    protected String getEmail()
    {
        return email;
    }
    protected String getPhone()
    {
        return phone;
    }
    protected String getPassword()
    {
        return password;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        if (email != null ? !email.equals(user.email) : user.email != null) return false;
        if (name != null ? !name.equals(user.name) : user.name != null) return false;
        if (password != null ? !password.equals(user.password) : user.password != null) return false;
        if (phone != null ? !phone.equals(user.phone) : user.phone != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (phone != null ? phone.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {

        return
                "\nNAME:" + name +
                " EMAIL:" + email+
                " PHONE:" + phone ;
    }


}
